/*
 * display.h
 *
 *  Created on: Dec 9, 2011
 *      Author: Jonathan Marokhovsky
 */


#ifndef GAMEPLAYER_H_
#define GAMEPLAYER_H_
#include <curses.h>
/* This is how long the program will wait for input before shutting down automatically */
#define IDLE_TIME		5 // in seconds
#define SERV_TIMEOUT	2 // in seconds

char *theMessage;

WINDOW *theWindow;

/*
 * This connects to the server at SERV_IP at port SERV_PORT
 *
 * This is a UDP connection so it's not really a "connection" per se...
 */
int connectToServer(char *name, char avatar, int port, int serverSocket, char theIP[]);

/*
 * This makes a new window with no cursor etc.
 */
WINDOW *newWin(void);

/*
 * This displays the given string
 */
int displayWin(WINDOW* win, char newScreen[]);

/*
 * This makes it so curses closes correctly
 */
void cleanUp(int sig);

/*
 * This interprets if the user has selected an action (either a move or a shot).  This returns 1 if
 * it is an action key, otherwise it returns 0.  This will work with caps lock on as well.
 *
 * The move keys are W, A, S, and D.
 *
 * The shot keys are I, J, K, and L.
 */
int interpretAction(char cmd);


#endif /* GAMEPLAYER_H_ */
